package com.mvc.demo.controller;

import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * @author H
 * @date 2023/1/10
 */
@RestController
@RequestMapping("/mediaType")
public class TestMediaTypeController {

    @GetMapping(value = "/testGet", consumes = MediaType.ALL_VALUE, produces = MediaType.TEXT_PLAIN_VALUE)
    @ResponseStatus(HttpStatus.CREATED)
    public String testGet() {
        System.out.println("Get接收到请求");
        return "yes";
    }

    @PostMapping(value = "/testPost", consumes = MediaType.ALL_VALUE, produces = MediaType.TEXT_PLAIN_VALUE)
    @ResponseStatus(HttpStatus.CREATED)
    public String testPost() {
        System.out.println("Post接收到请求");
        return "yes";
    }

}
